package com.jy.rhin.config.infra;

import com.jy.common.UIDWorker;
import com.jy.rhin.infra.feign.ManagerService;
import lombok.Getter;
import lombok.Setter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Getter
@Setter
@Configuration
public class UIDWorkerConfig {

    @Autowired
    ManagerService managerService;

    @Bean
    public UIDWorker uidWorker() {
        return new UIDWorker(managerService.getRemoteWorkId("rhin-aggr-service"));
    }

}
